from llmtcg.chat.tool import Function, FunctionParameters
from pydantic import Field

from typing import Type
from datetime import datetime


class ConsolePrinterParameters(FunctionParameters):
    content: str = Field(description="the content to print")


class ConsolePrinter(Function[ConsolePrinterParameters]):

    def get_function_name(self) -> str:
        return "ConsolePrinter"

    def get_function_description(self) -> str:
        return "Print the given content to the current console."

    def get_parameter_schema(self) -> Type[ConsolePrinterParameters]:
        return ConsolePrinterParameters

    def call(self, args: ConsolePrinterParameters) -> str:
        print(args.content)
        return "the content has been successfully printed."
